Exploring the online world is my passion. have experience of #content writing #SEO #Digital Marketing #On-Page #Lead Generation #Content Analyst #Marketing Analyst...
I could never stop at one point, continuously wanted to acquire more and more skills. My work for any organization will be full of passion and hard work.
Hemant Patel
02-Mar-2017First we come to interface and abstract class, both are just only a thought that’s can use for achieving multiple inheritance. When we know about some property of defined method, then we create an abstract class. Suppose that we create a class Bus and Car, then both have the property of clutch, brake and gear. Then if we know some property of brake, so we create abstract class and defined a function brake and give some functionality of brake, means in abstract class we declare and define the method. And this abstract class implemented by Bus and Car Classes. And if we want to change the algorithm of the parent class (abstract class) method, then we change in our child class.
But if we don't know about the functionality of method, then we create interfaces and just define a method and extend in child class. Suppose if we not know about Clutch and Gear functionality, then we define a method in an interface and extend in class Bus and Car. And change the algorithm of the parent class method (interface) in child class.